package org.wendu.wdoa.emp.dto;

import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;
import lombok.SneakyThrows;
import org.springframework.format.annotation.DateTimeFormat;
import org.wendu.wdoa.common.page.PageParam;

import java.util.Date;

@Data
public class EmpQueryDto extends PageParam {
    private String e_id;
    private String e_name;
    private Integer e_sex;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date e_birth_start;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date e_birth_end;
    private Integer d_id;
    @SneakyThrows
    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        String jsonStr = objectMapper.writeValueAsString(this);
        return jsonStr;
    }
}
